<%
	Dim FileName, FileValue, fso, MyFile
	Const ForReading = 1, ForWriting = 2
	Dim TodayDate
	Dim RTitle, RPresent, RCheck, RStart, RFinis, RDesc, RPrice
	Dim Season, NewSeason, OldSeason
	
	Season = Array("Winter", "Spring", "Summer", "Fall")
	TodayDate = Date
	NewSeason = GetSeason(Month(TodayDate))
	FileName = Server.MapPath("Text/cal.txt")
	Set fso = Server.CreateObject("Scripting.FileSystemObject")
	Set MyFile = fso.OpenTextFile(FileName, ForReading)
		Do While Not MyFile.AtEndOfStream
			FileValue = Trim(MyFile.ReadLine)
			
			If Left(FileValue, 7) ="[Title]" Then
				RTitle = Right(FileValue, Len(FileValue)-7)
				
				FileValue = Trim(MyFile.ReadLine)
				RPresent = Right(FileValue, Len(FileValue) - 7)
				
				FileValue = Trim(MyFile.ReadLine)
				RCheck = Right(FileValue, Len(FileValue) - 7)
				
				FileValue = Trim(MyFile.ReadLine)
				RStart = CDate(Right(FileValue, Len(FileValue) - 7))
				
				FileValue = Trim(MyFile.ReadLine)
				RFinis = CDate(Right(FileValue, Len(FileValue) - 7))
				
				FileValue = Trim(MyFile.ReadLine)
				RDesc = Right(FileValue, Len(FileValue) - 7)
				
				FileValue = Trim(MyFile.ReadLine)
				RPrice = Right(FileValue, Len(FileValue) - 7)
				
				'Read the Blank Line
				FileValue = MyFile.ReadLine
			
				If TodayDate <= RStart Then
					'NewYear = Year(RStart)
					'NewMonth = Month(RStart)
					NewSeason = GetSeason(Month(RStart))
					If NewSeason <> OldSeason Then
						Response.Write "<H2>" & Season(GetSeason(Month(RStart))) & " " & Year(RStart) & "<hr></H2>"
						OldSeason = NewSeason
					End If
					
					Response.Write "<H4>"
					If Month(RStart) = Month(RFinis) Then
						Response.Write MonthName(Month(RStart)) & " " & Day(RStart) & " "
						If RStart <> RFinis Then
							Response.Write "- " & Day(RFinis) & " "
						End If
					Else
						Response.Write MonthName(Month(RStart)) & " " & Day(RStart) & " - " & MonthName(Month(RFinis)) & " " & Day(RFinis) & " "
					End If
					
					Response.Write RTitle & "</H4>"
					Response.Write RCheck & " "
					If RPrice > 0 Then
						Response.Write "(Fee: $" & FormatNumber(RPrice, 2) & ") " & "<br>"
					End If
					If Len(RDesc) > 4 Then Response.Write RDesc
					Response.Write "Presenters: " & Replace(RPresent, "|", " - ") & "<br>"
					Response.Write "<br><br>"
				End If
			End If
		Loop
	MyFile.Close
	Set fso = Nothing
	
	Function GetSeason(MonthNum)
		Select Case MonthNum
			Case 1, 2, 3
				GetSeason = 0
			Case 4, 5, 6
				GetSeason = 1
			Case 7, 8, 9
				GetSeason = 2
			Case Else
				GetSeason = 3
		End Select
	End Function
%>